<template>
  <el-select v-model="options_value" placeholder="请选择分类">
    <el-option
      v-for="item in options"
      :key="item.key"
      :label="item.name"
      :value="item.key"
    />
  </el-select>
</template>

<script>
export default {
  props: {
    value: {
      required: true,
      default: () => '',
      type: [Number, String]
    },
    options: {
      default: () => [],
      type: Array
    }
  },
  computed: {
    options_value: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  }
}
</script>
